<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
<form action="">
用户名：<input name="username" type="text" onmousemove="test1()" onmouseout="test2()">
<p id="comment" style="display:none">用户名长度不能大于15个字符</p>
<br>
密码：<input name="pwd1" type="password">
<br>
确认密码：<input name="pwd2" type="password">
<br>
<input type="button" value="注册" onclick="clickhere()">
</form>
<script type="text/javascript">
//声明变量
var name="这是一个javascript变量";
alert(name);
alert("hello 你好");
//js方法的定义：function clickhere(){}
function clickhere(){
	alert("你点击了提交按钮");
	//调用另一个js方法
	comparepwd(123);
	var rs=add(11,23);
	alert(rs);
}
//有输入参数的js方法
function comparepwd(pwd){
	alert("这里是comparepwd"+pwd);
}
//有返回值的js方法
function add(v1,v2){
	return v1+v2;
}
function test1(){
	document.getElementById("comment").style.display="inline"
}
function test2(){
	document.getElementById("comment").style.display="none"
}
var test=["111","223","ff"];
var i=0;
for(i;i<test.length;i++){
	alert(test[i]);
}
</script>
</body>
</html>